/**
 * Created by guomin on 2017/4/28.
 */
var wish={
     //心愿列表
    getWishes:"select w.id,w.thumbnail,w.childname,w.age,w.childaddress,w.desc,w.like,w.status from wgy_wishes as w where w.upstatus=1 order by w.topindex desc,w.toptime desc,w.uptime desc limit ?,?",
    //已认领列表
    getClaimedWishes:"select w.id,w.thumbnail,w.childname,w.age,w.childaddress,w.desc,w.like,w.status from wgy_wishes as w where w.upstatus=1 and w.status in (1,2) order by w.topindex desc,w.toptime desc,w.uptime desc limit ?,?",
    //未认领列表
    getUnClaimedWished:"select w.id,w.thumbnail,w.childname,w.age,w.childaddress,w.desc,w.like,w.status from wgy_wishes as w where w.upstatus=1 and w.status=0 order by w.topindex desc,w.toptime desc,w.uptime desc limit ?,?",
    //心愿详情
    getWishDetailByID:"select w.id, w.childname,w.age,w.childaddress,w.pubcompany,w.thumbnail,w.desc,w.familydesc,w.claimantid,w.takename,w.takemobile,w.province,w.city,w.county,w.address,w.status,w.like,w.createtime from wgy_wishes as w where w.id=? and w.upstatus=1",
    //为TA加油
    updateLike:"update wgy_wishes as w set w.like=w.like+1 where w.id=? and w.upstatus=1",
    queryWishById:"select w.id,w.status from wgy_wishes as w where w.id=? and w.upstatus=1",
    updateClaimant:"update wgy_wishes as w set w.claimantid=?,w.status=1,w.claimtime=? where w.id=?",
    getClaimedWishList:"select w.id,w.thumbnail,w.childname,w.age,w.childaddress,w.desc,w.claimantid,w.takename,w.takemobile,w.province,w.city,w.county,w.address,w.like,w.status,w.claimtime from wgy_wishes as w where w.claimantid=? and w.upstatus=1 order by w.createtime desc",
    getClaimedWishCount:"select count(id) as count from wgy_wishes where claimantid=?"
};

exports=module.exports=wish;